﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="SGDemo.Web.Login" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>用户登录 - 辉煌装修信息管理系统</title>
    <link href="Styles/themes/css/login.css" rel="stylesheet" type="text/css" />
    <script src="Scripts/jquery-1.7.2.min.js" type="text/javascript"></script>
    <script src="Scripts/Plugins/jquery.extensions.js" type="text/javascript"></script>
    <script type="text/javascript">
        //是否为空，验证码
        //用户名是否存在
        //密码是否存在
        //用户是否审核，禁用

        //登录
        var doLogin = function () {
            var username = $.trim($('#txtUserName').val());
            var password = $.trim($('#txtPassword').val());
            var code = $.trim($('#txtCode').val());
            if (!username) {
                $('#msg').text('提示：用户名不能为空！');
                return false;
            }
            if (!password) {
                $('#msg').text('提示：密码不能为空！');
                return false;
            }
            if (!code) {
                $('#msg').text('提示：验证码不能为空！');
                return false;
            }

            var str = $.formatString("username={0}&password={1}&code={2}", username, password, code);
            cabLogin.PerformCallback(str);
        }

        //更改验证码
        var doChange = function () {
            capCode.Refresh();
            return false;
        }

        //开始执行回调时事件
        var doBeginCallback = function () {
            $('#btnLogin').fadeOut("fast", function () {
                $('#imgProcessBar').fadeIn("slow");
            });
            $('#msg').text('');
        }

        //回调完成
        var doCallbackComplete = function (s, e) {
            $('#imgProcessBar').fadeOut("fast", function () {
                $('#btnLogin').fadeIn("slow", function () {
                    //获取结果
                    var result = $.parseJSON(e.result);
                    $('#msg').text(result.msg);
                    if (result.isSuccess) {
                        //location.href = "ChooseToDept.aspx"
                        location.href = result.url;
                    } else {
                        $('#txtPassword').val('');
                    }
                });
            });
        }

        $(function () {
            if ($.browser.msie && ($.browser.version == "6.0" || $.browser.version == "7.0")) {
                $('#outVersion').css('display', 'block');
                $('#login').css('display', 'none');
            }
        });
    </script>
</head>
<body>
    <div id="login">
        <div id="login_header">
            <h1 class="login_logo">
                <a href="#">
                    <img src="Styles/themes/default/images/login_logo.jpg" /></a>
            </h1>
            <div class="login_headerContent">
                <div class="navList">
                    <ul>
                        <li><a href="#" onclick="javascript:window.external.AddFavorite('http://110.80.17.26:2234/','厦门辉煌装修信息管理系统')">
                            收藏</a></li>
                        <li><a href="#" onclick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://110.80.17.26:2234/');">
                            设为首页</a></li>
                    </ul>
                </div>
                <h2 class="login_title">
                    <img src="Styles/themes/default/images/login_title.jpg" /></h2>
            </div>
        </div>
        <div id="login_content">
            <div class="loginForm">
                <form id="form1" runat="server">
                <p>
                    <label>
                        用户名：</label>
                    <input id="txtUserName" type="text" name="username" size="20" class="login_input"
                        value="" style="width: 150px;" />
                </p>
                <p>
                    <label>
                        密码：</label>
                    <input id="txtPassword" type="password" name="password" size="20" class="login_input"
                        value="" style="width: 150px;" />
                </p>
                <p>
                    <table cellpadding="0" cellspacing="0" border="0">
                        <tr>
                            <td style="vertical-align: middle;">
                                <label>
                                    验证码：</label>
                            </td>
                            <td style="vertical-align: middle;">
                                <input id="txtCode" class="code" type="text" size="5" />
                            </td>
                            <td onclick="doChange();return false;" style="vertical-align: middle;">
                                <dx:ASPxCaptcha ID="capCode" ClientInstanceName="capCode" runat="server" Width="80"
                                    Height="40" CodeLength="4">
                                    <ValidationSettings ErrorDisplayMode="Text" />
                                    <ChallengeImage Width="80" Height="40" FontFamily="Tahoma" BackgroundColor="Transparent"
                                        ForegroundColor="#333300" BorderWidth="1" BorderColor="#A8AAB4" BackgroundImage-ImageUrl="Styles/themes/conmon/vcode.png">
                                    </ChallengeImage>
                                    <ValidationSettings EnableValidation="False">
                                    </ValidationSettings>
                                    <TextBox Visible="False" />
                                    <RefreshButton Visible="False">
                                    </RefreshButton>
                                    <LoadingPanel Enabled="False" />
                                    <ClientSideEvents />
                                </dx:ASPxCaptcha>
                            </td>
                        </tr>
                    </table>
                </p>
                <div class="login_bar">
                    <input id="btnLogin" class="sub" type="submit" value=" " onclick="doLogin();return false;" />
                    <img id="imgProcessBar" style="display: none" src="Styles/themes/default/images/progressBar/progressBar_l.gif" />
                </div>
                <div id="msg">
                </div>
                <dx:ASPxCallback ID="cabLogin" runat="server" ClientInstanceName="cabLogin" OnCallback="cabLogin_Callback">
                    <ClientSideEvents CallbackComplete="doCallbackComplete" BeginCallback="doBeginCallback" />
                </dx:ASPxCallback>
                </form>
            </div>
            <div class="login_banner">
                <img src="Styles/themes/default/images/login_banner.png" /></div>
            <div class="login_main">
                <ul class="helpList">
                    <li><a target="_blank" href="http://110.80.17.26:2234/Help/HelpList.aspx">查看帮助</a></li>
                    <li><a href="RetrievePassword.aspx">忘记密码怎么办？</a></li>
                    <li><a href="http://110.80.17.26:2234/Help/HelpList.aspx?HelpCategoryKeyid=E7A21BC7-9BC1-B69D-8609-0B5DA21AAE65#"
                        target="_blank">为什么登录失败？</a></li>
                </ul>
                <div class="login_inner">
                    <p>
                        您可以使用 成员管理 ，随时添加账号并且分配权限</p>
                    <p>
                        您还可以使用 自动办公 在桌面随时提醒公文到达，快速审批公文</p>
                    <p>
                        在 工程管理 里您可以查项目信息，证书情况，原料数据…</p>
                </div>
            </div>
        </div>
        <div id="login_footer">
            Copyright&nbsp;&nbsp;&copy;&nbsp;&nbsp;2012&nbsp;&nbsp;神冠软件&nbsp;&nbsp;保留所有权利
        </div>
    </div>
    <div id="outVersion" style="width: 600px; margin: 0 auto; margin-top: 50px; padding: 20px 0px;
        font-size: 16px; line-height: 30px; border: solid 1px #cccccc; display: none;">
        <p>
            <h3>您的IE浏览器版本过低，请升级到IE8.0或者更高版本</h3></p>
        <br />
        <p>
            如果您电脑操作系统是32位的Windows XP, <a href="UploadFile/Resource/IE8-WindowsXP-x86-CHS.rar">请点击此处下载IE8</a>
        </p>
        <br />
        <p>
            如果您电脑操作系统是32位的Windows Vista, <a href="UploadFile/Resource/IE8-WindowsVista-x86-CHS.rar">请点击此处下载IE8</a>
        </p>
        <br />
        <p>
            如果您电脑操作系统是32位的Windows Server 2003, <a href="UploadFile/Resource/IE8-WindowsServer2003-x86-CHS.rar">请点击此处下载IE8</a>
        </p>
        <br />
        <p>
            <a href="http://windows.microsoft.com/zh-CN/internet-explorer/downloads/ie-8" target="_blank">
                IE8官方下载地址</a>
        </p>
    </div>
</body>
</html>
